#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

bool isDigital(char ch)
{
	return ch >= '0' && ch <= '9';
}

int main()
{
	string s;
	int begin = -1,len =0;
	cin >> s;

	for(int fast = 0;fast<s.size();fast++)
	{
		if (isDigital(s[fast]))
		{
			int slow = fast;
			while (fast < s.size() && isDigital(s[fast]))
			{
				fast++;
			}
			if (fast - slow > len)
			{
				begin = slow;
				len = fast - slow;
			}
		}
	}

	cout << s.substr(begin, len);

	return 0;
}